#include<iostream>
using namespace std;

long long int factorial( int );

int main()
{
    cout << "Enter a number and apply the factorial:";
    int a;
    cin >> a;
    cout << "The result is: " << factorial(a) << endl;

    return 0;
}

long long int factorial( int a)
{
    if (!a)
    return 1;
    return a * factorial(a - 1);
}